import request from '@/utils/request';

export async function queryOneMaterial(params) {
  return request('/api/matMaterials/selectByCode', {
    params,
  });
}

export async function queryMaterial(params) {
  return request('/api/matMaterials/selectByPage', {
    params,
  });
}
export async function removeMaterial(params) {
  return request(`/api/matMaterials/delete/${params.materialId}`, {
    method: 'POST',
    data: { },
  });
}
export async function addMaterial(params) {
  return request('/api/matMaterials/add', {
    method: 'POST',
    data: { ...params },
  });
}
export async function updateMaterial(params) {
  return request('/api/matMaterials/edit', {
    method: 'POST',
    data: { ...params },
  });
}

export async function onSale(params) {
  return request('/api/matMaterials/onSale', {
    method: 'POST',
    data: { ...params },
  });
}

export async function offSale(params) {
  return request('/api/matMaterials/offSale', {
    method: 'POST',
    data: { ...params },
  });
}
